#include<bits/stdc++.h>
using namespace std;
//#define int long long

struct node
{
	int x, y;
}dao[500];

const int inf = 0x3f3f3f3f;
double dist[500];
double a[500][500];
bool vis[500];
int n;

double prim()
{
	double ans = 0;
	dist[1] = 0;
	for(int i = 1;i <= n;i++)
	{
		double diss = inf;
		int next = -1;
		for(int j = 1;j <= n;j++)
		{
			if(!vis[j] && (diss > dist[j]))
			{
				next = j;
				diss = dist[j];
			}
		}
//		cout<<next<<" "<<ans<<endl;
		if(next == -1 || dist[next] == inf)
			return inf;
		ans += dist[next];
		vis[next] = 1;
		for(int j = 1;j <= n;j++)
			dist[j] = min(dist[j], a[next][j]);
	}
	return ans;
}

signed main()
{
	int t;
	cin>>t;
	while(t--)
	{
		cin>>n;
		memset(vis, 0, sizeof vis);
//		memset(a, 0x3f, sizeof a);
//		memset(dist, 0x3f, sizeof dist);
		for(int i = 1;i <= n;i++)
		{
			for(int j = 1;j <= n;j++)
				a[i][j] = inf;
			dist[i] = inf;
		}
		int x, y, t;
		for(int i = 1;i <= n;i++)
			cin>>dao[i].x>>dao[i].y;
		for(int i = 1;i <= n;i++)
			for(int j = i+1;j <= n;j++)
			{
				double tt = sqrt(1.0*(dao[i].x-dao[j].x)*(dao[i].x-dao[j].x)+(dao[i].y-dao[j].y)*(dao[i].y-dao[j].y));
				if(10 <= tt && tt <= 1000)
					a[i][j] = a[j][i] = tt;
//				else
//					cout<<a[i][j]<<" ";
//				cout<<tt<<" ";
			}
//			cout<<endl;
		
		double ans = prim();
		if(ans != inf)
			cout<<fixed<<setprecision(1)<<ans*100<<endl;
		else
			cout<<"oh!"<<endl;
	}
	cout<<endl;
	system("pause");
	return 0;
}

